package com.aube.interact.taste.model;

import com.huyn.baseframework.utils.StringUtils;

import java.io.Serializable;
import java.util.List;

/**
 * Created by huyaonan on 16/11/24.
 */
public class CardStyleModel implements Serializable {

    public String animationEffects;
    public String relativePosition;
    public List<Coordinate> pointPercentVoList;

    public int getRelativePosition() {
        if(StringUtils.isNotBlank(relativePosition)) {
            try {
                int relativePos = Integer.parseInt(relativePosition);
                if(relativePos >=0 && relativePos <= 8)
                    return relativePos;
                return -1;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return -1;
    }

    public float[] getCardIndex() {
        float[] result = new float[2];
        if(pointPercentVoList != null && pointPercentVoList.size() > 0) {
            result[0] = pointPercentVoList.get(0).pointxPercent;
            result[1] = pointPercentVoList.get(0).pointyPercent;
        }
        return result;
    }

}
